All Questions
7 questions
3votes
1answer
125views
Presenter pattern implementation
I've recently discovered patterns and decided to implement Presenter pattern inside a pedagogical project. I spent few days playing around with different implementations, reading some Gem's source ...
3votes
2answers
733views
Seed a database
I'm looking for advice / best practice to avoid doing a deeply nested set of IF/THEN statements in Rails. The intention is to ...
1vote
1answer
57views
Old and new shouts controllers
I have a photo_shouts_controller.rb and text_shouts_controller.rb which both have almost similar implementations, and I would like to refactor it. I have implemented a refactoring but I am not too ...
4votes
2answers
293views
Decorator pattern for an application
I've created a decorator in my Rails application. However, the initializer has 3 params. Is this generally acceptable in decorator or should I refactor this or try a different pattern? ...
1vote
1answer
105views
Manager for customer billing and subscriptions in Rails
I'm looking to get rid of a couple dependencies that I have a sneaking suspicion are present in the code that I'm writing. Right now I have a service class that manages my subscriptions for part of ...
2votes
1answer
345views
How can I refactor Api::SessionsController?
I have session controller for mobile devices. I would like to refactor it a little, for example because my session controller is sub class of ...
1vote
1answer
488views
Complex dashboard using presenters and/or service objects
TL;DR I need a way to refactor a complex user dashboard with several objects and some complex data to display a accounting chart. I have read about both presenters (also called decorators or view ...